{include file='public/header' /}
<style>
    .work{
        width:300px;
        margin-top: 10px
    }
    .work1{
        width:100px;
        margin-top: 10px
    }

</style>
<style>
    #demo2{
        display: flex;
        align-items: center;
    }
    #demo2 li .operate{ color: #000; display: none;}
    #demo2 li .close{position: absolute;top: 5px; right: 5px;cursor:pointer;}
    #demo2 li:hover .operate{ display: block;}
    .operate{
        position: absolute;
        right: 0;
        top: -9px;
        color: black;
        font-size: 34px;
        /* border: 1px solid red; */
        font-weight: bold;
    }
    .item_img{
        position: relative;margin-right: 10px;
    }
    .attribute{
        width: 100%;
        border: 1px solid #e6e6e6;
        margin-top:20px;
    }
    .atr{
        height: 50px;
        border: 1px solid #e6e6e6;
    }
    .ath{
        width: 100px; border-left: 1px solid #e6e6e6; border-right: 1px solid #e6e6e6;
    }
    .atd{
        display: flex;
        text-align: center;
        height: 38px;
        justify-content: center;
        align-items: center;
    }
    table input{
        text-align: center;
        border: none!important;
    }
    table td{
        border-right: 1px solid #e6e6e6;
        border-bottom: 1px solid #e6e6e6;
    }
    table td:last-child{
        border-right: none;
    }
</style>
<div class="layui-card">
    <div class="layui-card-body">
        <form class="layui-form" action="{:__url('business.order/edit',['id'=>$row.id])}}" method="post">

            <div class="layui-form-item">
                <label for="" class="layui-form-label">订单编号:</label>
                <div class="layui-form-mid layui-word-aux">{$row.order_sn}</div>
            </div>

            <div class="layui-form-item">
                <label for="" class="layui-form-label">订单金额:</label>
                <div class="layui-form-mid layui-word-aux">{$row.amount}</div>

            </div>

            <div class="layui-form-item">
                <label for="" class="layui-form-label">支付类型:</label>

                <div class="layui-form-mid layui-word-aux">
                    {if condition="$row->pay_type eq 1"}
                    微信支付
                    {elseif condition="$row->pay_type eq 2"}
                    积分兑换
                    {elseif condition="$row->pay_type eq 3"}
                    支付宝支付
                    {/if}
                </div>



            </div>

            <div class="layui-form-item">
                <label for="" class="layui-form-label">商品信息:</label>
                <div class="layui-form-mid layui-word-aux">{$row.goods.title}</div>

            </div>


            <div class="layui-form-item">
                <label for="" class="layui-form-label">用户昵称:</label>
                <div class="layui-form-mid layui-word-aux">{$row.user.nick_name}</div>
            </div>

            <div class="layui-form-item">
                <label for="" class="layui-form-label">订单状态:</label>
                <div class="layui-form-mid layui-word-aux">
                    {if condition="$row->status eq 0"}
                    待成团
                    {elseif condition="$row->status eq 1" /}
                    已成团,待领取
                    {elseif condition="$row->status eq 2" /}
                    退款中
                    {elseif condition="$row->status eq 3" /}
                    已退款
                    {elseif condition="$row->status eq 4" /}
                    已评价
                    {elseif condition="$row->status eq 5" /}
                    已领取
                    {elseif condition="$row->status eq 6" /}
                    拼团失败
                    {/if}
                </div>
            </div>

            <div class="layui-form-item">
                <label for="" class="layui-form-label">下单时间:</label>
                <div class="layui-form-mid layui-word-aux">{$row.create_time}</div>

            </div>

            <div class="layui-form-item">
                <label for="" class="layui-form-label">学生姓名:</label>
                <div class="layui-form-mid layui-word-aux">{$row.user_info.user_name}</div>

            </div>
            <div class="layui-form-item">
                <label for="" class="layui-form-label">学生年龄:</label>
                <div class="layui-form-mid layui-word-aux">{$row.user_info.age}</div>

            </div>
            <input type="hidden" name="id" value="{$row.id}">
            <div class="layui-form-item">
                <label for="" class="layui-form-label">学校名称:</label>
                <div class="layui-form-mid layui-word-aux">{$row.user_info.school}</div>

            </div>
            {if $row.status == 1}
            <div class="layui-form-item">
                <label for="" class="layui-form-label">确认已领取:</label>
                <div class="layui-input-inline">
                    <input type="radio" name="status" disabled value="1" title="待领取"  >
                    <input type="radio" name="status" value="5" title="已领取 "checked >
                </div>

            </div>
            {/if}
        </form>
    </div>
</div>
{include file='public/footer' /}
<script>

    layui.use(['upload','layer','element','form'],function () {
        var $ = layui.jquery;
        var upload = layui.upload;

        var layer = layui.layer;
        var form = layui.form;
        //普通图片上传
        $(".uploadPic").each(function (index,elem) {
            upload.render({
                elem: $(elem)
                ,url: '{:__url("admin/upload/upload")}'
                ,multiple: false
                ,data:{"_token":"{{ csrf_token() }}"}
                ,done: function(res){
                    //如果上传失败
                    if(res.code == 0){
                        layer.msg(res.msg,{icon:1},function () {
                            $(elem).parent('.layui-upload').find('.layui-upload-box').html('<li><img src="'+res.url+'" /><p>上传成功</p></li>');
                            $(elem).parent('.layui-upload').find('.layui-upload-input').val(res.url);
                        })
                    }else {
                        layer.msg(res.msg,{icon:2})
                    }
                }
            });
        })

        //多图片上传
        upload.render({
            elem: '#test2',
            url: '{:__url("admin/upload/upload")}'
            //上传接口
            ,
            data:{"_token":"{{ csrf_token() }}"},
            multiple: false,

            before:function (obj) {
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
//                    $('#demo2').append()
                });
            },
            done: function (res) {
                //上传完毕
                if (res.code == 0) {
                    //console.log(111)
                    $('#demo2').append('<li class="item_img"><div class="operate"></i><i  class="close layui-icon"></i></div><img src="' + res.url + '" class="layui-upload-img" width="60"><input type="hidden" name="image[]" value="' + res.url + '"></li>');
                } else {
                    layer.msg(res.msg,{icon:2})
                }
            }
        });
//点击多图上传的X,删除当前的图片
        $("body").on("click",".close",function(){
            $(this).closest("li").remove();
        });
        $(".uploadVideo").each(function (index,elem) {
            upload.render({
                elem: $(elem)
                ,url: '{:__url("admin/upload/upload")}'
                ,multiple: false
                ,accept: 'video' //视频
                ,data:{"_token":"{{ csrf_token() }}"}
                ,done: function(res){
                    //如果上传失败
                    if(res.code == 0){
                        layer.msg(res.msg,{icon:1},function () {

                            $(elem).parent('.qa-xx-item').find('.layui-upload-input').val(res.url);
                        })
                    }else {
                        layer.msg(res.msg,{icon:2})
                    }
                }
            });
        })

    })
</script>
<link href="/baidu-editor/themes/default/css/umeditor.min.css" type="text/css" rel="stylesheet">
<script src="/baidu-editor/third-party/jquery.min.js"></script>
<!-- 配置文件 -->
<script type="text/javascript" src="/baidu-editor/umeditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/baidu-editor/umeditor.min.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UM.getEditor('container');
</script>
